package com.wei.order;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;

/**
 *  Order_0000001	Pdt_01	222.8
	Order_0000001	Pdt_05	25.8
	Order_0000002	Pdt_03	522.8
	Order_0000002	Pdt_04	122.4
 * @author Administrator
 *
 */
public class Order implements Writable{
	private String orderId;
	private String productId;
	private double amount;
	
	public Order() {}
	
	public void set(String orderId, String productId, double amount) {
		this.orderId = orderId;
		this.productId = productId;
		this.amount = amount;
	}


	public String getOrderId() {
		return orderId;
	}
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	public String getProductId() {
		return productId;
	}
	public void setProductId(String productId) {
		this.productId = productId;
	}
	public double getAmount() {
		return amount;
	}
	public void setAmount(double amount) {
		this.amount = amount;
	}

	@Override
	public String toString() {
		return "orderId=" + orderId + ", productId=" + productId
				+ ", amount=" + amount;
	}

	@Override
	public void write(DataOutput out) throws IOException {
		out.writeUTF(orderId);
		out.writeUTF(productId);
		out.writeDouble(amount);
	}

	@Override
	public void readFields(DataInput in) throws IOException {
		this.orderId=in.readUTF();
		this.productId=in.readUTF();
		this.amount=in.readDouble();
	}
	
	
	
}
